<?php
/**
 * classe que represento os logins de cada usuario
 * @access public
 * @author Magno Leal
 * @package model
 */
class LoginBean {

    private $loginID;
    private $data;
    private $ip;
    private $usuario;

    function __construct($loginID = 0, $data = "", $ip = "", $usuario = null) {
        $this->loginID = $loginID;
        $this->data = $data;
        $this->ip = $ip;
        $this->usuario = $usuario;
    }

    public function getLoginID() {
        return $this->loginID;
    }

    public function setLoginID($loginID) {
        $this->loginID = $loginID;
    }

    public function getData() {
        return $this->data;
    }

    public function setData($data) {
        $this->data = $data;
    }

    public function getIp() {
        return $this->ip;
    }

    public function setIp($ip) {
        $this->ip = $ip;
    }

    public function getUsuario() {
        return $this->usuario;
    }

    public function setUsuario($usuario) {
        $this->usuario = $usuario;
    }

    public function toJson() {
        return json_encode($this->toBD());
    }

    public function toBD() {
        $login = array();

        $login['loginID'] = $this->loginID;
        #$login['data'] = $this->data;
        #$login['ip'] = $this->ip;
        $login['usuarioID'] = $this->usuario->getUsuarioID();

        return $login;

    }
}
?>
